package com.zizo.bbs;

import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class CreateDir implements Runnable {
	public static boolean createDir(String destDirName) {
		File dir = new File(destDirName);
		// 创建目录
		if (dir.mkdirs()) {
			System.out.println("创建目录" + destDirName + "成功！");
			return true;
		} else {
			System.out.println("创建目录" + destDirName + "失败！");
			return false;
		}
	}

	public static void main(String[] args) {
		ExecutorService fix = Executors.newFixedThreadPool(50);
		for (int i = 1; i < 6001; i++) {
			fix.execute(new CreateDir("C:/mnt/mirror/autohome/bbs/" + i));
		}
	}

	private String pathname;

	public CreateDir(String pathname) {
		super();
		this.pathname = pathname;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run() {
		createDir(this.pathname);
	}

}
